#!/usr/bin/env python3
"""
Transformer测试配置文件
定义测试环境的共享设置和fixtures
"""
import pytest
import torch
import sys
import os

# Add the models directory to the path
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', 'models'))

@pytest.fixture
def sample_tensor():
    """Fixture providing a sample tensor for testing"""
    return torch.randn(10, 2, 512)

@pytest.fixture
def transformer_model():
    """Fixture providing a pre-configured transformer model"""
    from models.model import TransformerModel
    return TransformerModel(input_dim=512, output_dim=256, nhead=8, num_layers=6)

@pytest.fixture
def text_generator():
    """Fixture providing a text generator instance"""
    from models.text_generator import TextGenerator
    return TextGenerator(vocab_size=10000, embedding_dim=512, nhead=8, num_layers=6)

@pytest.fixture
def audio_generator():
    """Fixture providing an audio generator instance"""
    from models.audio_generator import AudioGenerator
    return AudioGenerator(input_dim=256, output_dim=128, nhead=8, num_layers=6)

@pytest.fixture
def image_generator():
    """Fixture providing an image generator instance"""
    from models.image_generator import ImageGenerator
    return ImageGenerator(input_dim=512, output_dim=256, nhead=8, num_layers=6)

@pytest.fixture
def video_generator():
    """Fixture providing a video generator instance"""
    from models.video_generator import VideoGenerator
    return VideoGenerator(input_dim=1024, output_dim=512, nhead=8, num_layers=6)